<%--
  User: Shengzhao Li
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<!DOCTYPE html>
<html>
<head>
    <title>账务表单 - Cooking Account</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/cooking-main.css"/>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/js/web/jqueryui/1.10.3/jquery-ui-1.10.3.custom.min.css"/>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery/jquery-1.8.0.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/web/jqueryui/1.10.3/jquery-ui-1.10.3.custom.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/web/jqueryui/jquery.ui.datepicker-zh-CN.js"></script>

</head>
<body>
<div class="page">
    <h1>账务表单</h1>
    <form:form commandName="cookingAccount" modelAttribute="cookingAccount" id="form">
        <table width="60%">
            <tr>
                <td><label for="date">日期:</label></td>
                <td>
                    <form:input path="date" cssClass="input"/>
                    <form:errors path="date" cssClass="form-error" id="date"/>
                </td>
            </tr>
            <tr>
                <td><label for="amount">金额:</label></td>
                <td>
                    <form:input path="amount" id="amount" cssClass="input" placeholder="请输入金额..."/>
                    <form:errors path="amount" cssClass="form-error"/>
                </td>
            </tr>
            <tr>
                <td><label for="creator">记录人:</label></td>
                <td>
                    <form:select path="creatorGuid" id="creator" items="${users}" itemLabel="nickName" itemValue="guid"
                                 cssClass="input">
                    </form:select>
                    <form:errors path="creatorGuid" cssClass="form-error"/>
                </td>
            </tr>
            <tr>
                <td valign="top"><label for="description">描述:</label></td>
                <td>
                    <form:textarea path="description" id="description" placeholder="请输入账务描述..."
                                   cssStyle="resize: none;width: 300px;height: 40px;"/>
                    <form:errors path="description" cssClass="form-error"/>
                </td>
            </tr>
            <tr>
                <td>&nbsp;</td>
                <td>
                    <a class="offline-button" href="javascript:void(0);" onclick="$('#form').submit();">保存</a>
                    &nbsp;<a href="overview">取消</a>
                </td>
            </tr>
        </table>
    </form:form>
</div>
<script>
    $(function() {
        $("#date").datepicker({
            dateFormat:"yy-mm-dd",
            regional:"zh-CN"
        }).attr("readonly", "readonly");
    });
</script>
</body>
</html>
